package com.lanxiao.cloud.modules.oauth.application.dto;

import com.lanxiao.cloud.modules.oauth.infrastructure.enums.LoginType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;

/**
 * @author ：qiaoliang
 * @date ：2021-09-13
 */
@ApiModel("登录请求模型")
public class LoginCmd {
  @ApiModelProperty(value = "类型")
  @NotNull(message = "登录类型不能为空.")
  private LoginType loginType;
  @ApiModelProperty(value = "标识（手机号 邮箱 用户名或第三方应用的唯一标识）")
  @NotNull(message = "登录标识不能为空.")
  private String principal;
  @ApiModelProperty(value = "密码凭证（站内的保存密码，站外的不保存或保存token）")
  @NotNull(message = "登录密码不能为空.")
  private String credential;

  public LoginCmd() {
  }

  public LoginCmd(LoginType loginType, String principal, String credential) {
    this.loginType = loginType;
    this.principal = principal;
    this.credential = credential;
  }

  public LoginType getLoginType() {
    return loginType;
  }

  public String getPrincipal() {
    return principal;
  }

  public String getCredential() {
    return credential;
  }

}
